package com.ruoyi.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.SysMatDetailsTypeMapper;
import com.ruoyi.domain.SysMatDetailsType;
import com.ruoyi.service.ISysMatDetailsTypeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 材料详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-03
 */
@Service
public class SysMatDetailsTypeServiceImpl implements ISysMatDetailsTypeService 
{
    @Autowired
    private SysMatDetailsTypeMapper sysMatDetailsTypeMapper;

    /**
     * 查询材料详情
     * 
     * @param matDetailsId 材料详情ID
     * @return 材料详情
     */
    @Override
    public SysMatDetailsType selectSysMatDetailsTypeById(Integer matDetailsId)
    {
        return sysMatDetailsTypeMapper.selectSysMatDetailsTypeById(matDetailsId);
    }

    /**
     * 查询材料详情列表
     * 
     * @param sysMatDetailsType 材料详情
     * @return 材料详情
     */
    @Override
    public List<SysMatDetailsType> selectSysMatDetailsTypeList(SysMatDetailsType sysMatDetailsType)
    {
        return sysMatDetailsTypeMapper.selectSysMatDetailsTypeList(sysMatDetailsType);
    }

    /**
     * 新增材料详情
     * 
     * @param sysMatDetailsType 材料详情
     * @return 结果
     */
    @Override
    public int insertSysMatDetailsType(SysMatDetailsType sysMatDetailsType)
    {
        sysMatDetailsType.setMatDetailsCreateTime(new Date());
        return sysMatDetailsTypeMapper.insertSysMatDetailsType(sysMatDetailsType);
    }

    /**
     * 修改材料详情
     * 
     * @param sysMatDetailsType 材料详情
     * @return 结果
     */
    @Override
    public int updateSysMatDetailsType(SysMatDetailsType sysMatDetailsType)
    {
        sysMatDetailsType.setMatDetailsCreateTime(new Date());
        return sysMatDetailsTypeMapper.updateSysMatDetailsType(sysMatDetailsType);
    }

    /**
     * 删除材料详情对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysMatDetailsTypeByIds(String ids)
    {
        return sysMatDetailsTypeMapper.deleteSysMatDetailsTypeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除材料详情信息
     * 
     * @param matDetailsId 材料详情ID
     * @return 结果
     */
    @Override
    public int deleteSysMatDetailsTypeById(Integer matDetailsId)
    {
        return sysMatDetailsTypeMapper.deleteSysMatDetailsTypeById(matDetailsId);
    }

    @Override
    public List<SysMatDetailsType> selectSysMatDetailsTypeLists(String matDataType) {
        return sysMatDetailsTypeMapper.selectSysMatDetailsTypeLists(matDataType);
    }

    @Override
    public List<SysMatDetailsType> selectSysMatDetailsTypematdatatypeYC(String name) {
        return sysMatDetailsTypeMapper.selectSysMatDetailsTypematdatatypeYC(name);
    }
}
